package org.tlipoca.smsteamachievement.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.genntii.smcommon.result.Result;
import org.genntii.smdomain.entity.SteamAchievement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tlipoca.smsteamachievement.service.SteamAchievementService;

import java.util.ArrayList;
//TODO 待测试
@Tag(name = "Steam成就")
@Slf4j
@RestController
@RequestMapping("/steam_achievement")
public class SteamAchievementController {

    @Autowired
    private SteamAchievementService steamAchievementService;

    @GetMapping("/{appid}")
    @Operation(summary = "根据Appid获取游戏成就")
    public Result<ArrayList<SteamAchievement>> getAchievementByAppid(@PathVariable Integer appid) {
        return Result.success(steamAchievementService.getAchievementByAppidService(appid));
    }
}
